package me.zk.practice1.hw;

import java.util.Scanner;

/**
 * @author zhangkai
 * @date 2023/8/9 14:44
 */
public class HWBJ50 {
    public static void main(String[] args) {
        Scanner scanner= new Scanner(System.in);

        int x = scanner.nextInt();

        int y = scanner.nextInt();

        int t = scanner.nextInt();

        int xadd = 1;
        int yadd = 1;
        for (int i = 0; i < t; i++) {
            if (x == 0) {
                xadd=1;
            }
            if (y==0){
                yadd=1;
            }
            if (x+50 == 800) {
                xadd=-1;
            }
            if (y+25 == 600) {
                yadd=-1;
            }
            x+=xadd;
            y+=yadd;

        }
        System.out.println(x + " " + y);
    }
}
